package com.ricky.base.util;

import java.io.File;
import java.io.IOException;

/**
 * @author Ricky
 * @date 2020/11/27
 */
public class PathUtil {
    public static String getFullPath(String path) {
        try {
            return new File(path).getCanonicalPath();
        } catch (IOException e) {
            e.printStackTrace();
        }
        if (path.lastIndexOf("/") == path.length() - 1) {
            path = path.substring(0, path.length() - 1);
        }
        return path;
    }
}
